import request from "@/utils/request.ts";
import Enum from "@/api/homeApi/enum.ts";
import type { Response } from "@/types/commonTypes/commonTypes.ts";
import type { NewItem, Banner, Brand, Category, HotItem, Product, Special } from "@/types/homeTypes/homeTypes.ts";
/*获取全部分类的接口*/
export const fetchCategoryListAPI = (): Promise<Response<Category[]>> => request.get<any, Response<Category[]>>(Enum.category);
/*获取品牌的接口*/
export const fetchBrandListAPI = (limit: number): Promise<Response<Brand[]>> => request.get<any, Response<Brand[]>>(Enum.brand, { params: { limit } });
/*获取轮播图的接口*/
export const fetchBannerListAPI = (): Promise<Response<Banner[]>> => request.get<any, Response<Banner[]>>(Enum.banner);
/*获取新鲜好物的接口*/
export const fetchNewListAPI = (): Promise<Response<NewItem[]>> => request.get<any, Response<NewItem[]>>(Enum.newList);
/*获取人气推荐的接口*/
export const fetchHotListAPI = (): Promise<Response<HotItem[]>> => request.get<any, Response<HotItem[]>>(Enum.hotList);
/*获取产品区块的接口*/
export const fetchProductListAPI = () => request.get<any, Response<Product[]>>(Enum.productList);
/*获取最新专题的接口*/
export const fetchSpecialListAPI = (limit: number): Promise<Response<Special[]>> => request.get<any, Response<Special[]>>(Enum.special, { params: { limit } });
